<?
include_once 'lib/facebook.php';
include_once 'includes/config.php';
include_once 'includes/dbconnect.php';
include_once 'tableObjects/TblMember.php';
include_once 'includes/function.php';
$_SESSION['pid'] = 'instruction';

$do_not_redirect = 1;

include_once 'includes/header.php';


if(!empty($_GET['question_id'])){
?>
<script>

    try{
        if(window.top.location.toString().indexOf("http://www.facebook.com") != 0 && window.top.location.toString().indexOf("https://www.facebook.com") != 0){
            window.top.location = "<?= FACEBOOK_PAGE_TAB_URL ?>";
        }		
    }
    catch(err)
    {
    
    }			
</script>
<? } ?>
<link type="text/css" href="includes/css/jquery.jscrollpane.css" rel="stylesheet" media="all" />
<style type="text/css" id="page-css">
    /* Styles specific to this particular page */
    .scroll-pane
    {
        width: 100%;
        height: 570px;
        overflow: auto
    }
    .horizontal-only
    {
        height: auto;
        max-height: 200px;
    }
    ul li {
        list-style:none;
        margin:5px 0;
    }

    input {
        margin:0 0 0 8px;
    }
</style>



<script type="text/javascript" src="includes/js/jquery.jscrollpane.min.js"></script>
<script type="text/javascript" src="includes/js/jquery.mousewheel.js"></script>

<script>(function(d, s, id) {
    var js, fjs = d.getElementsByTagName(s)[0];
    if (d.getElementById(id)) return;
    js = d.createElement(s); js.id = id;
    js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=<?= trim(FACEBOOK_APP_ID) ?>";
    fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>


<table width="800" cellpadding="0" cellspacing="0"   >

    <Tr>
        <td width="100%">
            <table width="100%">
                <tr>
                    <td height="50" bgcolor="#fec832" style="padding-left:20px">
                        <img src="images/title_shareyourviews.png">
                    </td>
                </tr>
                <tr>
                    <Td width="100%" style="border:1px solid #f5f5f5;background-color:#f1f1f1;padding-left:20px;padding-right: 5px">
                        <div class="scroll-pane">
                            <table width="100%">
                                <?
                                $get_question = mysql_query("select * from tbl_view_question order by created_datetime desc");
                                
                                $no = mysql_num_rows($get_question);
                                while ($q = mysql_fetch_assoc($get_question)) {
                                    ?>
                                    <tr>
                                        <td class="title">
                                            <?= $no . ". " . $q['question'] ?>
                                        </td>

                                    </tr>
                                    <tr>
                                        <Td style="text-align: right"><font style="color:#6e6e6e;font-size:12px"><?= date("M j", strtotime($q['created_datetime'])) ?> at <?= date("g:i a", strtotime($q['created_datetime'])) ?></font></td>
                                    </tr>
                                    <tr>
                                        <td><div class="fb-comments" data-href="<?= SOURCE_URL ?>/share_view.php?question_id=<?= $q['id'] ?>" data-num-posts="5" data-width="750"></div></td>
                                    </tr>
                                    <tr>
                                        <td style="background:url(images/divider_h.jpg) repeat-x center" height="30">&nbsp;</td>
                                    </tr>

                                    <?
                                    $no--;
                                }
                                ?>
                            </table>
                        </div>
                        <script>
                        $(function()
                        {
                            $('.scroll-pane').jScrollPane(
                                {
                                    autoReinitialise: true,
                                    scrollbarWidth : 100
                                }
                            );
                        });
                        </script>
                    </td>
                </tr>
            </table>
        </td>
    </tr>

</table>
<?
include_once 'includes/footer.php';
?>